package com.nsfocus.file;

import java.io.IOException;
import java.io.RandomAccessFile;

import javax.xml.bind.SchemaOutputResolver;

/**
 * @File:   RandomAccessFileDemo.java
 * @User:   Liangkangkang
 * @Date:   17-4-23
 * @Time:   上午11:4-212
 * @Mail:   liangkangkang@yahoo.com
 * @Desc:
 * @Version:
 */
public class RandomAccessFileDemo {
    public static void main(String[] args) {
        RandomAccessFile raf = null;

        try {
            raf = new RandomAccessFile("/home/lkk/4-21", "rw");
            raf.seek(raf.length() + 20);
            raf.writeBytes("hell world");
        } catch (IOException e) {
            e.printStackTrace();
        }

        try {
            raf.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

        System.out.println("over");
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
